/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.orderoid.ejb.domain;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Dahlia
 */
@Entity
@Table(name = "statut_commande")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "StatutCommande.findAll", query = "SELECT s FROM StatutCommande s"),
    @NamedQuery(name = "StatutCommande.findByIdStatut", query = "SELECT s FROM StatutCommande s WHERE s.idStatut = :idStatut"),
    @NamedQuery(name = "StatutCommande.findByLibelle", query = "SELECT s FROM StatutCommande s WHERE s.libelle = :libelle")})
public class StatutCommande implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "successeur")
    private int successeur;
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_statut")
    private Integer idStatut;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 30)
    @Column(name = "libelle")
    private String libelle;

    public StatutCommande() {
    }

    public StatutCommande(Integer idStatut) {
        this.idStatut = idStatut;
    }

    public StatutCommande(Integer idStatut, String libelle) {
        this.idStatut = idStatut;
        this.libelle = libelle;
    }

    public Integer getIdStatut() {
        return idStatut;
    }

    public void setIdStatut(Integer idStatut) {
        this.idStatut = idStatut;
    }

    public String getLibelle() {
        return libelle;
    }

    public void setLibelle(String libelle) {
        this.libelle = libelle;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idStatut != null ? idStatut.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof StatutCommande)) {
            return false;
        }
        StatutCommande other = (StatutCommande) object;
        if ((this.idStatut == null && other.idStatut != null) || (this.idStatut != null && !this.idStatut.equals(other.idStatut))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return libelle; 
        // return "org.orderoid.ejb.domain.StatutCommande[ idStatut=" + idStatut + " ]";
    }

    public int getSuccesseur() {
        return successeur;
    }

    public void setSuccesseur(int successeur) {
        this.successeur = successeur;
    }
    
}
